package demo1;

import java.util.Arrays;

public class Solution2 {

    public void merge(int A[], int m, int B[], int n) {
        for (int i = 0; i < B.length; i++) {
            A[m + i] =B[i];
        }
        for (int i = 0; i < A.length; i++) {
            for (int j = 0; j < A.length - 1 - i; j++) {
                if(A[j] > A[j + 1]) {
                    int tem = A[j];
                    A[j]= A[j +1];
                    A[j + 1] = tem;
                }

            }
        }
    }

    public static void main(String[] args) {
        Solution2 sm = new Solution2();
        int [] A = new int[] {1,2,3 };
        int [] B = new int[] {4,5,6 };
        sm.merge(A,A.length,B,B.length);
    }
}
